package com.tepusoft.wx.config;

import com.jfinal.config.*;
import com.jfinal.ext.plugin.shiro.ShiroPlugin;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.druid.DruidPlugin;
import com.jfinal.plugin.ehcache.EhCachePlugin;
import com.tepusoft.wx.controller.HelloController;
import com.tepusoft.wx.model.User;

/**
 * User: GIE
 * Date: 2015/12/15
 * description：
 */
public class DemoConfig extends JFinalConfig {
	public void configConstant(Constants me) {
		me.setDevMode(true);
	}
	public void configRoute(Routes me) {
		me.add("/hello", HelloController.class);
	}
	public void configPlugin(Plugins me) {
		me.add(new EhCachePlugin());
		DruidPlugin druidPlugin = new DruidPlugin("jdbc:mysql://localhost/test","root","root");
		me.add(druidPlugin);
		ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
		me.add(arp);
		arp.addMapping("user", User.class);
	}
	public void configInterceptor(Interceptors me) {
	}
	public void configHandler(Handlers me) {}
}